import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/found',
    name: 'Found',
    component: () => import('../views/Found.vue'),
    redirect: '/found/topic',
    children: [
      {
        path: 'reading',
        name: 'Reading',
        component: () => import('../views/foundChild/ReadingPage.vue')
      },
      {
        path: 'daily-sign',
        name: 'DailySign',
        component: () => import('../views/foundChild/DailySignPage.vue')
      },
      {
        path: 'topic',
        name: 'Topic',
        component: () => import('../views/foundChild/TopicPage.vue')
      },
      {
        path: 'qa',
        name: 'QA',
        component: () => import('../views/foundChild/QAPage.vue')
      },
      {
        path: 'long-article',
        name: 'LongArticle',
        component: () => import('../views/foundChild/LongArticlePage.vue')
      },
      {
        path: 'note',
        name: 'Note',
        component: () => import('../views/foundChild/NotePage.vue')
      },
      {
        path: 'hot-list',
        name: 'HotList',
        component: () => import('../views/foundChild/HotListPage.vue')
      },
      {
        path: 'book-movie',
        name: 'BookMovie',
        component: () => import('../views/foundChild/BookMoviePage.vue')
      },
      {
        path: 'music',
        name: 'Music',
        component: () => import('../views/foundChild/MusicPage.vue')
      },
      {
        path: 'author',
        name: 'Author',
        component: () => import('../views/foundChild/AuthorPage.vue')
      }
    ]
  },
  {
    path: '/search',
    name: 'Search',
    component: () => import('../views/Search.vue'),
    redirect: '/search/search-all',
    children: [
      {
        path: 'search-all',
        name: 'SearchAll',
        component: () => import('../views/searchChild/SearchAll.vue')
      },
      {
        path: 'search-daily-sign',
        name: 'SearchDailySign',
        component: () => import('../views/searchChild/SearchDailySign.vue')
      },
      {
        path: 'search-reading',
        name: 'SearchReading',
        component: () => import('../views/searchChild/SearchReading.vue')
      },
      {
        path: 'search-radio',
        name: 'SearchRadio',
        component: () => import('../views/searchChild/SearchRadio.vue')
      },
      {
        path: 'search-music',
        name: 'SearchMusic',
        component: () => import('../views/searchChild/SearchMusic.vue')
      },
      {
        path: 'search-book-movie',
        name: 'SearchBookMovie',
        component: () => import('../views/searchChild/SearchBookMovie.vue')
      },
      {
        path: 'search-author',
        name: 'SearchAuthor',
        component: () => import('../views/searchChild/SearchAuthor.vue')
      }
    ]
  },
  {
    path: '/radio',
    name: 'Radio',
    component: () => import('../views/Radio.vue')
  },
  {
    path: '/my',
    name: 'My',
    component: () => import('../views/My.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
